﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WindowsPhoneAppHost.MyControl
{
    public partial class TabBar : UserControl
    {
        private Button currentButton;
        //private Array buttons;
        public TabBar()
        {
            InitializeComponent();
            //buttons.
//
//            this.button1.Background = new SolidColorBrush(Colors.Green);
//            this.button2.Background = new SolidColorBrush(Colors.Green);
//            this.button3.Background = new SolidColorBrush(Colors.Green);
            SetCurrent();
        }

        private void SetCurrent()
        {
            currentButton = this.button1;
        }

        public string TitleText
        {
            get { return this.button1.Content.ToString(); }
            set { this.button1.Content = value; }
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;
            MessageBox.Show(currentButton.Name);
            button.Background = new SolidColorBrush(Colors.Orange);
//            MessageBox.Show(button.Background.ToString());
            this.currentButton.Background = new SolidColorBrush(Colors.Green);
            this.currentButton = button;
            this.button1.Background = new SolidColorBrush(Colors.Green);
            //Colors.
            //SystemColors.
//            MessageBox.Show(currentButton.Name);
        }
    }
}
